
import java.awt.Graphics;
import java.util.ArrayList;
import javax.swing.JComponent;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author pson
 */
public class Dice {
    
    ArrayList<Die> pool;

    /**
     * Creates a new set of dice with no die in the pool
     */
    public Dice() {
        pool = new ArrayList<Die>();
    }
    
    /**
     * Creates a new set of dice with [num] die of [sided] sides each
     * @param num Number of die to add to the pool
     * @param sided Number of sides of each die
     */
    public Dice(int num, int sided) {
        this();
        for (int i = 0; i < num; i++) {
            pool.add(new Die(sided));
        }
    }
    
    public int roll() {
        int sum = 0;
        for (Die die : pool) {
            sum += die.roll();
        }
        return sum;
    }
    
}
